package server

import (
	"github.com/gin-gonic/gin"
	"github.com/go-kratos/kratos/v2/transport/http"
	http2 "go_private_im/internal/logic/http"
)

func NewHttpServer(server *http2.Server,middleware  *http2.Middleware) *http.Server {
	engine := gin.New()
	engine.Use(middleware.LoggerHandler,middleware.RecoverHandler)
	server.InitRouter(engine)
	httpSrv := http.NewServer(http.Address(":8000"))
	httpSrv.HandlePrefix("/", engine)
	return httpSrv
}
